'/
' ProjectName
' 
' =========================================================================
' 
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
' 
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
' 
' You should have received a copy of the GNU General Public License
' along with this program.  If not, see <http://www.gnu.org/licenses/>.
'/

'// This namespace class contains all the functions used by console commands.
type CommandManager extends Base

	function shutdown_client:int(args:string)
	
		sMaster.m_stopEvent = true;
	
	end function
	
	function reset_video:int(args:string)
	
		sVideo.init(sMaster.p_refreshRate, sMaster.p_screenWidth, sMaster.p_screenHeight);
	
	end function
	
	function set_fullscreen_mode:int(args:string)
	
		sMaster.p_fullscreen = true;
	
	end function
	
	function set_window_mode:int(args:string)
	
		sMaster.p_fullscreen = false;
	
	end function
	
	function toggle_fps_text:int(args:string)
	
		sMaster.p_drawFps = args.toInt();
	
	end function
	
	'// -------------------------------------------------------------------------------------------------------------
	'// Make sure you never create an instance of this object, since it's acting as a namespace.
	'// -------------------------------------------------------------------------------------------------------------
	method new()
	
		local id:string = TTypeId.forObject(self).name()
		runtimeError("Illegal to create an instance of a namespace class '" + id + "'.")
	
	end method

end type
